import React from "react";
import lazyLoad from "@/routers/utils/lazyLoad";
import { LayoutIndex } from "@/routers/constant";
import { RouteObject } from "@/routers/interface";

// 常用组件模块
const userRouter: Array<RouteObject> = [
	{
		element: <LayoutIndex />,
		meta: {
			title: "权限管理"
		},
		children: [
			{
				path: "/auth/userManage",
				element: lazyLoad(React.lazy(() => import("@/views/AuthManage/UserManage"))),
				meta: {
					requiresAuth: true,
					title: "用户管理",
					key: "userManage"
				}
			},
			{
				path: "/auth/roleManage",
				element: lazyLoad(React.lazy(() => import("@/views/AuthManage/RoleManage"))),
				meta: {
					requiresAuth: true,
					title: "角色管理",
					key: "roleManage"
				}
			},
			{
				path: "/system/tenantManage",
				element: lazyLoad(React.lazy(() => import("@/views/AuthManage/TenantManage"))),
				meta: {
					requiresAuth: true,
					title: "租户管理",
					key: "TenantManage"
				}
			},
			{
				path: "/system/resourceManage",
				element: lazyLoad(React.lazy(() => import("@/views/AuthManage/ResourceManage"))),
				meta: {
					requiresAuth: true,
					title: "菜单管理",
					key: "ResourceManage"
				}
			},
			{
				path: "/system/adminManage",
				element: lazyLoad(React.lazy(() => import("@/views/AuthManage/AdminManage"))),
				meta: {
					requiresAuth: true,
					title: "管理员管理",
					key: "AdminManage"
				}
			},
		]
	}
];

export default userRouter;
